package com.sunday.fangdaifu.activity.task;

import android.graphics.Color;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.sunday.common.base.BaseActivity;
import com.sunday.common.utils.ToastUtils;
import com.sunday.fangdaifu.R;
import com.sunday.fangdaifu.widgets.MenuItem;
import com.sunday.fangdaifu.widgets.SectorMenu;

public class DirectionActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_direction);
        String[] mStrs = new String[]{"北", "东北", "东", "东南",
                "南", "西南", "西", "西北"};
        SectorMenu sectorMenu = (SectorMenu)findViewById(R.id.menu);
        for(int i=0;i<mStrs.length;i++){
            MenuItem item = new MenuItem(String.valueOf(i), getResources().getDrawable(R.mipmap.ic_launcher),null,mStrs[i], ContextCompat.getColor(mContext,R.color._63b1ff));
            sectorMenu.addMenuItem(String.valueOf(i),item);
            sectorMenu.setOnMenuSelectListener(new SectorMenu.OnMenuSelectListener() {
                @Override
                public void onSelect(MenuItem menuItem, String item) {
                    ToastUtils.showToast(mContext,item+"");

                }
            });
        }

    }
}
